renderThinking uses shaders for the purpose of evaluating specific shading calculations and, consequently, defining the appearance of the objects.
A shader can be defined as a C-code function that is provided with some data which defines its operating environment in the form of input variables. Based upon these variables, a result is calculated and communicated back to the renderer by means of output variables.
Simply stated, it is a collection of information describing all the surface peculiarities of an object.
A shader can be controlled precisely by means of arguments that define its specific function. Shaders can have zero, one or more arguments and these may each be of a simple or composite data type, including integers, floating point values, colors, vectors and enumerations.
A shader can be seen as a 'black box', which is expected to perform some computations and provide its results to the rendering subsystem unseen by the user, via a number of global variables.
Shader Classes
There are different classes of shaders, each usable in a particular circumstance and for a specific purpose.
They are: